package com.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.SpecialDAO;
import com.pojo.Special;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@SuppressWarnings("ALL")
@Service
public class SpecialService extends ServiceImpl<SpecialDAO, Special> {

    @Autowired
    private SpecialDAO specialDAO;


    /**
     * 获取所有可用的专题
     * @return
     */
    public List<Special> getAll() {
        QueryWrapper q = new QueryWrapper();
        q.eq("state", 1);
        q.orderByAsc("sort");
        return specialDAO.selectList(q);
    }
}
